so = libHelloNative.so
src = HelloNative.c
class = $(shell find . -name '*.java' |sed s/\.java/\.class/g)
all: $(so) $(class)

%.class: %.java
	${JAVA_HOME}/bin/javac $< 

$(so): $(src)
	gcc -shared -fPIC -I ${JAVA_HOME}/include/ -I ${JAVA_HOME}/include/linux $< -o $@

clean:
	rm -f *.class *.so
